package com.fingard.dsp.bank.reqrespobj.currtransperiod.detail;

import com.fingard.FGBiz;
import com.fingard.dsp.core.specialdeal.PayStateHelper;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by F on 2018/11/19.
 */
public class RetAtsCurrTransPerDetail {


    public String respCode;
    public String respInfo;
    public String reqSeqID;
    public String rate;
    public String transState;
    public String payInfoCode;

    public void writeToXml(XmlTextWriter retXmlWriter, String p_bankCode, String p_transType)throws Exception{
        retXmlWriter.writeStartElement("DetailRecord");

        if(FGBiz.dspCenter.convertPayState&&respCode.equals("0")){
            PayStateHelper payStateHelper=new PayStateHelper(p_bankCode,p_transType,respInfo,transState,payInfoCode);
            payStateHelper.toBank();
            transState=payStateHelper.payState;
            payInfoCode=payStateHelper.payInfo;
        }

        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
        retXmlWriter.writeElementString("TransState", transState);
        retXmlWriter.writeElementString("ReqSeqID", reqSeqID);
        retXmlWriter.writeElementString("PayInfoCode", payInfoCode);
        retXmlWriter.writeElementString("Rate",rate);
        retXmlWriter.writeEndElement();
    }
}
